#include <cstdio>

int main( )
{
    int n, minn;
    double t, v, p;
    while ( scanf("%d", &n) != EOF && n )
    {
        minn = 0xfffff;
        while ( n-- )
        {
            scanf("%lf%lf", &v, &p);
            if ( p < 0 )
                continue;
            t = 4500 * 3.6 / v + p;
            if ( t != int( t ) )
                t++;
            if ( minn > int( t ) )
                minn = int( t );
        }
        printf("%d\n", minn);
    }
    return 0;
}
